import React, { Component } from 'react';
// hoc:high order component 高阶组件，是一个函数，函数的参数和返回值都是组件
const fn = (C) => {
  return class extends Component {
    render() {
      return (
        <>
          <p>我是通过高阶组件添加的内容</p>
          <C></C>
        </>
      )

    }
  }
}
const ComA = class ComA extends Component {
  render() {
    return (
      <>
        <h1>我是comA</h1>
      </>
    )
  }
}
const ComB = class ComB extends Component {
  render() {
    return (
      <>
        <h1>我是comB</h1>
      </>
    )
  }
}
// let Comchildren = memo(Comchildren1);
let ComAFn = fn(ComA);
let ComBFn = fn(ComB);
class Hoc extends Component {
  render() {
    return (
      <div>
        <ComAFn></ComAFn>
        <ComBFn></ComBFn>
      </div>
    );
  }
}

export default Hoc;
